<?php
//error_reporting(0);
header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, GET-check=0, max-age=0');
header('Pragma: no-cache');
header("Content-Type: text/html; charset=UTF-8");
/*-------------------------------------------------------------------------------------*/
define("MCTDESIGN",true);
session_start();
/*-------------------------------------------------------------------------------------*/
include('./_inc/config.php');
include('./_adm/_language/vietnamese.php');
include('./_inc/connect.php');
include('./_inc/functions.php');
include('./_adm/_includes/_adm_variable.php');
include('./_adm/_includes/_adm_function.php');
include('./_adm/_includes/_adm_defined.php');
require_once('./_classes/_classes.inc.php');
require_once('./_adm/_includes/_adm_ajax.php');
require_once('./_classes/class.paging.php');

/*smarty*/
$temp = new Smarty_McT();
$temp->smarty_admin();
/*variable*/
/*kiem tra dang nhap*/
check_login();
/*thong tin quan tri*/
$info_admin = base64_decode($admin_session);
$info_admin = addslashes($info_admin);
$info_admin = explode(":", $info_admin);
$admin_id = $info_admin[0];
$admin_user = $info_admin[1];
$admin_permissions = $permissions = permissions("".$info_admin[0]."");

$temp->assign(array(
						"_adm_username" => "".$info_admin[1]."",
						"_adm_fullname" => "".$info_admin[3]."",
						"_adm_email" => "".$info_admin[4]."",
                        "_cf_shop_name" => $shop_name,
                        "_cf_shop_url" => $shop_url,
                        "_gn" => ghi_nho_cv(),
                        "sta" => show_thongke()
					)
				);
switch($obj){
	case "Config":
		include("./_adm/_adm_config.php");
		break;
	case "Admin":
		include("./_adm/_adm_administrator.php");
		break;
	case "Category":
		include("./_adm/_adm_catalogy.php");
		break;
    case "CategoryPost":
        include("./_adm/_adm_catalogy_post.php");
		break;
    case "Places":
        include("./_adm/_adm_places.php");
		break;    	
	case "Manufacturer":
		include("./_adm/_adm_manufacturer.php");
		break;
	case "Support":
		include("./_adm/_adm_yahoo.php");
		break;
	case "Post":
		include("./_adm/_adm_news_post.php");
		break;
	case "Product":
		include("./_adm/_adm_product.php");
		break;
    case "Language":
		include("./_adm/_adm_language.php");
		break;    
    case "Slide":
		include("./_adm/_adm_slideshow.php");
		break;    
	case "Logos":
		include("./_adm/_adm_logos.php");
		break;	
    case "Blocks":
        include("./_adm/_adm_blocks.php");
        break;    
    case "Tour":
        include("./_adm/_adm_tour.php");
        break;        
    case "Hotels":
        include("./_adm/_adm_hotels.php");
        break;                                
	case "Logout":
        visited($admin_id,"update");
		session_destroy();
		$html_body = _html_trans("Bạn đã không còn đăng nhập.","admin.php");
		break;
	case "ChangePass":
		include("./_adm/_admin_change.php");
		break;
	case "Home":
		$html_body = _html_Home();
		break;
	default : 
		$html_body = _html_Error();
		break;
}
//session_destroy();
// get all lang on data 
$sql = "select * from ".$tb_fix."_lang order by lang_id asc";
$q = $anyDB->query($sql);
$r = $anyDB->getAll($q);
$temp->assign('la', $r);
$temp->assign('session_lang',$_SESSION['mctadmlang']);
$temp->assign('adm_lang_default',adm_get_lang_default());
$temp->assign('adm_tem_dir',$dir_tpl);
$temp->assign( 'body', "".$html_body."" );
$temp->assign( 'obj', "".$obj."" );
$temp->assign( 'mctlang',$mctlang);
$temp->display('_admin_main.mct');
?>